<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String uuid = UUID.randomUUID().toString();
    request.setAttribute("uuid", uuid);
%>
<div class="container-fluid am-margin-top">
	<form id="reqReturnForm">
	    <input type="hidden" name="id"/>
		<div class="row">
			<div class="col-md-12">
				<div class="form-group"><label>退回环节</label>
					<select class="form-control"  name="thhj" disabled="disabled">
		                <option value=""></option>
		            </select>
				</div>
			</div>
			<div class="col-md-12">
				<div class="form-group"><label>释放原因</label>
					<select class="form-control"  name="sfyy" disabled="disabled">
		                <pf:dataDic var="item" dicCode="SFYY">
		                    <option value="${item.value}">${item.name}</option>
		                </pf:dataDic>
		            </select>
				</div>
			</div>
			<div class="col-md-12">
				<div class="form-group"><label>其他说明</label>
					<textarea name="qtsm"  class="form-control" disabled="disabled"></textarea>
				</div>
			</div>
		</div>
	</form>
	<nav class="navbar navbar-default">
	  <div class="container-fluid">
	  	<div class="collapse navbar-collapse">
	  		<ul class="nav navbar-nav navbar-right">
		  		<li>
		  			<button type="button" class="btn btn-primary navbar-btn" id="submitReturnBtn">释放</button>
		  		</li>
		  	</ul>
        </div>
	  </div>
	</nav>
</div>
<script type="text/javascript">
	
    $(function () {
    	var winId = '${param.winId}';
    	var sfid = '${param.sfid}';
    	$.getJSON(ctx + '/workOrderAct/queryReqReturnDealById.do', {id:sfid}, function (data) {
            //初始化表单数据
        	webUtils.fullForm({
                form: $("#reqReturnForm"),
                data: data.req
            });
            $("select[name=thhj] > option").eq(0).html(data.node.HJMC+"("+data.node.CLRXM+")");
    	});
    	$("#submitReturnBtn").click(function(){
    		var returnNodeName= $("select[name=thhj] > option").eq(0).html();
    		layer.confirm('确认释放工单,退回['+returnNodeName+']？', {
         		  btn: ['是','否'] //按钮
       		}, function(index){
   	    		var data = {id:$("input[name=id]").val(),returnNodeName:returnNodeName};
   	    		webUtils.topicPublish("dialog.submit.success."+winId, data);
       			layer.close(index);
       		});
    	});
    });    
</script>
